package VN.EDU.IMIC.DEVELOPER.TRINHCAOSANG.ExceptionHandling;

public class Throw {
	/*
	 * Cú pháp : 
		 throw exception;  
		Ví dụ đơn giản để ném IOException:
		throw new IOException("Sorry : device error);   
	 */
	 static void validate(int tuoi){  
	     if(tuoi<20)  
	      throw new ArithmeticException("Chua du tuoi ket hon");  
	     else  
	      System.out.println("Ban da du tuoi ket hon");  
	   }  
	   public static void main(String args[]){  
	      validate(13);  
	      System.out.println("Other Code...");  
	  }  
}
